# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-network-core
pkgver=1.0.63
pkgrel=2
pkgdesc='DDE network library and plugins'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/dde-network-core"
license=('GPL3')
depends=(deepin-qt-dbus-factory gsettings-qt networkmanager-qt)
makedepends=(cmake deepin-control-center gtest ninja qt5-tools)
groups=(deepin)
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/dde-network-core/archive/$pkgver.tar.gz"
        $pkgname-ldflags.patch::https://github.com/linuxdeepin/dde-network-core/pull/54.patch)
sha512sums=('b792e2352623ee0b9d5ccbc0979f7cf7d4275bc8e8193ccdd1ea194d721ce0d7f9525e5b517e9021df5691b7b8b36f909595abf88936ced2f4c34a621ecd8fbf'
            '4a940572d6c95abc03acc25522ee072697b1ad05fd7b311d553a541d0d4dcd4bc1877a562721b5e2b22f854b1ac6046d04a95301f6d7261c7ceabe5346c12081')

prepare() {
  cd dde-network-core-$pkgver
  patch -p1 -i ../$pkgname-ldflags.patch
}

build() {
  cd dde-network-core-$pkgver
  cmake -GNinja .
  ninja
}

package() {
  cd dde-network-core-$pkgver
  DESTDIR="$pkgdir" ninja install
}
